package rateexchange.client;

import rateexchange.client.ui.RatesTableView;
import rateexchange.client.ui.RatesTableViewImpl;
import rateexchange.shared.AppRequestFactory;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.place.shared.PlaceController;

@SuppressWarnings("deprecation")
public class ClientFactoryImpl implements ClientFactory{
	private static final EventBus eventBus = new SimpleEventBus();
	private static final RatesTableView rateview = new RatesTableViewImpl();
	private static final PlaceController placecontroller = new PlaceController(eventBus);
	private static final AppRequestFactory requestfactory = GWT.create(AppRequestFactory.class);
	
	public EventBus getEventBus() {
		return eventBus;
	}

	@Override
	public PlaceController getPlaceController() {
		return placecontroller;
	}

	@Override
	public RatesTableView getRatesTable() {
		return rateview;
	}

	
	@Override
	public AppRequestFactory getRequestFactory() {
		requestfactory.initialize(eventBus);
		return requestfactory;
		
	}

}
